 package hrm.serviceimple;

import hrm.dao.CamDAO;
import hrm.dao.EmployeeDAO;
import hrm.dao.OrgDAO;
import hrm.daoimple.CamDAOImple;
import hrm.dto.cam.CamDTO;
import hrm.dto.cam.CamViewDTO;
import hrm.service.CamService;

import java.util.List;

public class CamServiceImple implements CamService{
	
	private CamDAO camDAO;
	private EmployeeDAO employeeDAO;
	private OrgDAO orgDAO;
	
	private static CamServiceImple camService;
	
	private CamServiceImple(){
		camDAO=new CamDAOImple();
	}
	
	public static CamServiceImple getInstance(){
		if (camService==null) {
			camService=new CamServiceImple();
		}
		return camService;
	}

	public void setOrgDAO(OrgDAO orgDAO) {
		this.orgDAO = orgDAO;
	}

	public void setEmployeeDAO(EmployeeDAO employeeDAO) {
		this.employeeDAO = employeeDAO;
	}

	public void setCamDAO(CamDAO camDAO) {
		this.camDAO = camDAO;
	}

	@Override
	public List<CamViewDTO> getAllCam(CamViewDTO dto) {
		return camDAO.getAllCam(dto);
	}

	@Override
	public CamViewDTO getCam(CamViewDTO dto) {
		return camDAO.getCam(dto);
	}

	@Override
	public void insertCam(CamDTO dto) {
		camDAO.insertCam(dto);
	}

	@Override
	public void updatePreCam(CamDTO dto) {
		camDAO.updatePreCam(dto);
	}

	@Override
	public void decideCam(CamDTO dto) {
		camDAO.updatePreCam(dto);
	}
	
	public boolean camCancel(CamDTO dto) {
		return camDAO.camCancel(dto);
	}
}
